package com.bw.glide_sdk;

import android.widget.ImageView;

import com.bumptech.glide.load.resource.bitmap.CircleCrop;

public class LoadImage {
    public static void LoadMatchImg(String url, ImageView image) {
        GlideApp.with(image.getContext())
                .load(url)
                .placeholder(R.mipmap.ic_launcher)
                .error(R.mipmap.ic_launcher)
                .into(image);
    }

    public static void loadThumnall(String thumbnailUrl, String srcUrl, ImageView image) {
        //添加缩略图请求  imageview西岸战事缩略图 在展示原图
        //通过罗略图进行展示过度
        GlideApp.with(image.getContext())
                .load(srcUrl)
                .thumbnail(GlideApp.with(image.getContext())
                        .load(thumbnailUrl))
                .into(image);
    }

    public static void LoadCirImg(String url, ImageView image) {
        GlideApp.with(image.getContext())
                .load(url)
                .placeholder(R.mipmap.ic_launcher)
                .transform(new CircleCrop())
                .error(R.mipmap.ic_launcher)
                .into(image);
    }
}
